package com.pzl.simple.wvlib;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;

import androidx.annotation.Nullable;
//webview进程处理远程调用实现
public class WebViewRemoteImpl extends Service {

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return impl;
    }


    IWebViewService.Stub impl = new IWebViewService.Stub() {
        @Override
        public void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat, double aDouble, String aString) throws RemoteException {
        }

        @Override
        public void callJS(String jsFunction, String beanJsonStr) throws RemoteException {
            WebVeiwBrowserActivity instance = WebVeiwBrowserActivity.getInstance();
            if (instance == null) return;
            instance.callJS(jsFunction, beanJsonStr);
        }
    };


}
